AOF rewrite compacts the log by replaying the current state. It forks a child process, which triggers copy-on-write (CoW). On a write-heavy instance with large memory, this can spike memory usage (up to 2x) and increase latency as the OS copies dirty pages.